package com.iplatform.file.function.meta.domain;

import com.iplatform.module.privilege.group.DataSet;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


/**
 * @author heng
 * 数据表
 */
public class DataTable implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	private String id;

	/**
	 * 数据集配置
	 */
	private DataSet dataSet;
	
	/**
	 * 表名称
	 */
	private String name;
	
	/**
	 * 表名
	 */
	private String code;

	/**
	 * 表列
	 */
	private List<DataColumn> columns = new ArrayList<>();
	

	/**
	 * 表X轴
	 */
	private Integer left;
	

	/**
	 * 表Y轴
	 */
	private Integer top;
	
	/**
	 * 是否收缩关闭
	 */
	private String isClose;
	
	/**
	 * 	是否选择全部字段
	 */
	private String checkAll;

    public DataColumn getDataColumn(String columnCode) {
    	for(DataColumn dataColumn: columns) {
    		if(dataColumn.getCode().toLowerCase().equals(columnCode.toLowerCase())) {
    			return dataColumn;
    		}
    	}
    	return null;
    }

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public DataSet getDataSet() {
		return dataSet;
	}

	public void setDataSet(DataSet dataSet) {
		this.dataSet = dataSet;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public List<DataColumn> getColumns() {
		return columns;
	}

	public void setColumns(List<DataColumn> columns) {
		this.columns = columns;
	}

	public Integer getLeft() {
		return left;
	}

	public void setLeft(Integer left) {
		this.left = left;
	}

	public Integer getTop() {
		return top;
	}

	public void setTop(Integer top) {
		this.top = top;
	}

	public String getIsClose() {
		return isClose;
	}

	public void setIsClose(String isClose) {
		this.isClose = isClose;
	}

	public String getCheckAll() {
		return checkAll;
	}

	public void setCheckAll(String checkAll) {
		this.checkAll = checkAll;
	}





	
	
}
